import React from 'react';
import List from './pages/list'
import Input from './pages/input'


class App extends React.Component{
	state = {
		list: []
	}
	
	componentDidMount () {
		setTimeout(()=>{
			this.setState({
				list: ['aaa', 'bbb', 'ccc']
			})
		},1000)
	}
	
	addClick = (value)=>{
		console.log(value);
		const {list} = this.state;
		list.push(value);
		this.setState({
			list
		});
	}
	
	render(){
		const {list} = this.state
		return (
			<div>
				<Input click={this.addClick} length={list.length} />
				<List list={list} />
			</div>
		);
	}
}

export default App;
